<table style="margin:0 auto; margin-top:16px; margin-bottom:5px;">
    <colgroup width="62px;"></colgroup>
    <colgroup width="660px;"></colgroup>
    <colgroup width="62px;"></colgroup>
    <tr>
        <td><a href="{$has_prev}" id="left" class="f_right r_button"></a></td>
        <td style="vertical-align: middle; background: #fff;">

            <!--  START  -->
            <!-- Първоначална позиция на големия банер -->


            <div id="banner_s"  style="background: #fff;">
                <div id="small" style="width: 468px; height: 60px; margin: 0 auto; box-shadow:0px 0px 30px #fff;">

                    <script type="text/javascript"><!--
                    google_ad_client = "ca-pub-5472762465737265";
                    /* 468x60-gifs */
                    google_ad_slot = "8627974390";
                    google_ad_width = 468;
                    google_ad_height = 60;
                    //-->
                    </script>
                    <script type="text/javascript"
                            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                    </script>

                </div>
            </div>


            <!--  END  -->

        </td>
        <td><a href="{$has_next}" id="right" class="l_button f_left"></a></td>
    </tr>
</table>
<script>
    $(document).ready(function(){
        $("#fadee").hide(0).delay(0).fadeIn()
    });
</script>
<div style="min-height: 520px;">
<table id="fadee" style="margin: 0 auto; min-height: 300px; display: none;">
        <colgroup>
            <col style="width: 170px;" />
            <col style="width: 50px;" />
            <col style="width: 170px;" />
        </colgroup>
        <tr>
            <td>
            </td>
            <td>
                
                    <header style="height: 20px; overflow: hidden;">
                        <h2 class="f_left">{$photo['title']}<h2>
                            <div class="clear"></div>
                    </header>
                    <table>
                        <tr>
                            <td style="vertical-align: top">



                                <div id="blink" style="position: relative;">
                                    <img id="fade" src="{$photo['image']}" alt="{$photo['alt']}" title="{$photo['title']}" style="max-height: 500px;" class="box"/><br/>


                                    <div">


                                        <div class="fb_button_pages">

                                            <a href="javascript:void();" id="comments" class="f_left mr_5" ><img src="img/comments.png" /></a>
                                            <script type="text/javascript">
                                                $('#comments').click(function() {
                                                    $('#comments_div').toggle("slide");
                                                });
                                            </script>


                                            <div class="fb-like" data-href="{$curPageURL}" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
                                        </div>

                                    </div>
                                </div>
                            </td>
                            <td style="vertical-align: top">

                                <div class="fb-comments" id="comments_div" style="display: none;" data-href="{$photo['fb']}" data-width="280" data-num-posts="1"></div>

                            </td>
                        </tr>
                    </table>

                  <div id="fb-root"></div>
            </td>
            <td style="padding-left: 10px; vertical-align: top;">

            </td>
        </tr>
    </table>
</div>
<!--  START  -->
<!-- Първоначална позиция на малкия банер -->
<table style="margin:0 auto;">
    <tr>
        <td style=" max-height:500px;">
            <div style="position: static; bottom: 0px; left: 50%; right: 50%;"
            <div id="banner_l">
                <div id="large" style="width:728px; height:90px; margin:0 auto; box-shadow:0px 0px 30px #bbb;">
                    <script type="text/javascript"><!--
                    google_ad_client = "ca-pub-5472762465737265";
                    /* 728x90-gifs */
                    google_ad_slot = "7151241196";
                    google_ad_width = 728;
                    google_ad_height = 90;
                    //-->
                    </script>
                    <script type="text/javascript"
                            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                    </script>
                </div>
            </div>
            </div>
        </td>
    </tr>
    <tr>
        <td style="text-align: center;">
            <div style="color: #aaa; width: 708px; background: #fff; padding: 10px; box-shadow:0px 0px 30px #bbb; text-align: left; text-align: justify;line-height: 16px;">
                {if $albumContent != null} {$albumContent} {/if}
            </div>
        </td>
    </tr>
</table>
<!--  END  -->

<!-- START ALBUM CONTENT -->

<!-- FINISH ALBUM CONTENT -->

<footer>
    <p></p>
</footer>
<div style="width:1000px; height:0px; margin:0 auto;"></div>
<script type="text/javascript">


    var counter = {$counter}
    var defaultCounter = {$defaultCount};
    
    if (counter % defaultCounter == 0) {
        var small = $('#banner_s').html();
        var large = $('#banner_l').html();
        $('#banner_s').html(large);
        $('#banner_l').html(small);
    }

    var children = $(".fb_button_pages").children('div');
    var size = children.size();
    $(".fb_button_pages").children('div').hide();
    var rand_num = Math.floor(Math.random() * size) + 1;
    children.eq(rand_num - 1).show();

    
</script>

<script type="text/javascript">


// Image number loading bar

var imgCount = parseInt(<?php echo json_encode($countPics); ?>);
var album = <?php echo json_encode($get_album); ?>;

if(imgCount > 1) {
    
    var windowWidth = parseInt($(window).width());
    var pixelOffset = (windowWidth/imgCount).toFixed(0);
    var imgPosition = <?php echo json_encode($photo['position']); ?>;


    $('#imgLoadBar').width(pixelOffset * imgPosition);
}

</script>




</body>

</html>